#include<iostream>
#include<cstring>
using namespace std;
typedef long long LL;
const int N = 1e6 + 10, M = N * 2;
int h[N], e[M], ne[M], idx;
LL ans1, ans2;
int n;
LL ans;
int color[N];
void add(int a, int b)
{
	e[idx] = b, ne[idx] = h[a], h[a] = idx++;
}

void dfs(int u, int fa, int c)
{
	color[u] = c;
	if (color[u] == 1) {
		ans += ans2;
		ans1++;
	}
	else {
		ans += ans1;
		ans2++;
	}
	for (int i = h[u]; ~i; i = ne[i]) {
		int j = e[i];
		if (j == fa)continue;
		dfs(j, u, 3 - c);
	}
}
int main()
{
	cin >> n;
	memset(h, -1, sizeof(h));
	for (int i = 0; i < n - 1; i++) {
		int a, b;
		cin >> a >> b;
		add(a, b);
		add(b, a);
	}
	dfs(1, 0, 1);
	cout << ans - n + 1<< endl;
	return 0;
}